package cn.kimming.rpc.common.constant;

public enum SerializationWay {
    NONE((byte) -1), PROTOSTUFF((byte)1),HESSIAN((byte)2),JDK((byte) 3);

    SerializationWay(byte byteVal) {
        this.byteVal = byteVal;
    }

    private byte byteVal;
    
    public static SerializationWay getSerialization(byte byteVal) {
        SerializationWay[] serializationWays = SerializationWay.values();
        for (SerializationWay serializationWay : serializationWays) {
            if (serializationWay.byteVal == byteVal) {
                return serializationWay;
            }
        }
        return PROTOSTUFF;
    }

    public byte getByteVal() {
        return byteVal;
    }
}
